import { request } from '@/utils/service'

export const searchByTime = (start: string, end: string, itemName: string) => {
  return request({
    url: '/byTime',
    method: 'GET',
    params: {
      start,
      end,
      itemName,
    },
  })
}

export const searchByBuy = (userAccount: string, itemName?: string) => {
  return request({
    url: '/buyer',
    method: 'GET',
    params: {
      userAccount,
      itemName,
    },
  })
}

export const searchBySell = (userAccount: string, itemName?: string) => {
  return request({
    url: '/seller',
    method: 'GET',
    params: {
      userAccount,
      itemName,
    },
  })
}

export const searchByOrder = (orderId: string, itemName?: string) => {
  return request({
    url: '/order',
    method: 'GET',
    params: {
      orderId,
      itemName,
    },
  })
}

export const getUserMove = (params: anyObj) => {
  return request<MoveTrackTableRes>({
    url: '/moveTrack',
    method: 'GET',
    params,
  })
}

export const getBattleCount = (
  userAccount: string,
  start: string,
  end: string
) => {
  return request<any>({
    url: '/battleCount',
    method: 'GET',
    params: {
      userAccount,
      start,
      end,
    },
  })
}

export const getPetInfo = (params: IPetParams) => {
  return request<any>({
    url: '/petInfo',
    method: 'GET',
    params,
  })
}
